const path = require('path');
const common = require('./webpack.common');
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');


module.exports = merge(common, {
    mode: 'development',
    devtool: 'source-map',
    plugins: [
        new ESLintPlugin({
            context: path.resolve(process.cwd(), 'src'),
        }),
        new HtmlWebpackPlugin({
            template: path.resolve(process.cwd(), 'src/template.hbs'),
            filename: 'index.html',
            minify: false,
            inject: false,
        }),
    ],
    devServer: {
        port: 8080,
        host: '0.0.0.0',
        hot: false
    }
});